
import {
  HTTP
} from '/utils/http.js'
let Myhttp = new HTTP()

export class Authorize {
  startauthorize(parames) {
    wx.getSetting({
      success: (response) => {
        //console.log(response)
        if (!response.authSetting['scope.userInfo']) {
          wx.navigateTo({
            url: '/pages/authorize/index'
          })
        } else {
          wx.getUserInfo({
            success: (res) => {
              parames(res)
            }, 
            complete: (res) => {
              Myhttp.request({
                url: 'questionnaire/index/saveUserInfo',
                method: 'POST',
                data: res.rawData,
                success: (response) => {
                  
                }
              })
            }
          })
        }
      }
    })
  }
}